package com.weiweiqin.dao.impl;

import com.weiweiqin.dao.KjOrderCustomerDao;
import com.weiweiqin.model.KjOrderCustomer;
import org.springframework.stereotype.Repository;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Repository
public class KjOrderCustomerDaoImpl extends GenericMybatisDao<KjOrderCustomer, Integer>
		implements KjOrderCustomerDao {

	@SuppressWarnings("unchecked")
	public List<KjOrderCustomer> getByOrderId(int orderId) {
		return (List<KjOrderCustomer>)getSqlSession().selectList("KjOrderCustomer_getByOrderId",orderId);
	}


	@SuppressWarnings("unchecked")
	public KjOrderCustomer getByOrderIdAndCustomerId(int orderId,int customerId) {
		Map<String,Object> conditions = new HashMap<String, Object>();
		conditions.put("orderId", orderId);
		conditions.put("customerId", customerId);
		return (KjOrderCustomer)getSqlSession().selectOne("KjOrderCustomer_getByOrderIdAndCustomerId",conditions);
	}

	 

 
}